import 'package:flutter/material.dart';

// 填充Padding

class PaddingRoute extends StatefulWidget {
  @override
  _PaddingRouteState createState() => _PaddingRouteState();
}

class _PaddingRouteState extends State<PaddingRoute> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("填充Padding"),
      ),
      body: _PaddingRouteBody(),
    );
  }
}

class _PaddingRouteBody extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
      // 上下左右各添加16像素补白
      padding: EdgeInsets.all(16.0),
      child: Column(
        // 显示指定对齐方式为左对齐
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Padding(
            // 左边添加8像素补白
            padding: const EdgeInsets.only(left: 8.0),
            child: Text("hello world"),

          ),
          Padding(
            // 上下各添加8像素补白
            padding: const EdgeInsets.symmetric(vertical: 20.0),
            child: Text("I an jack"),
          ),
          Padding(
            // 左边添加8像素补白
            padding: const EdgeInsets.fromLTRB(20.0, 0, 20.0, 20.0),
            child: Text("your friend"),
          ),
        ],
      ),
    );
  }
}
